#include <config.h>
#include <stdio.h>
#include <kermit.h>

void main(void)
{
	int c;
	__attribute__((noreturn)) void (*bh)(void);

	puts("Welcome to MBOOT!\n");
	puts("Please select where to boot from(0 - serial, 1 - nand):");
	c = getchar();
	putc(c);
	puts("\n");
	
	if (c == '0') {
		kermit_recv((void *)CONFIG_BH_LOAD_ADDR);
	}

	bh = (void *)CONFIG_BH_RUN_ADDR;
	(*bh)();
}

